﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Problem : MonoBehaviour
{
    [SerializeField]
    private Image problemImage;
    [SerializeField]
    private ITGuyProblems problemType;
    [SerializeField]
    private float lastingTime;
    private float timer;

    public ITGuyProblems GetProblemType()
    {
        return problemType;
    }

    private void Start()
    {
        
    }

    private void Update()
    {
        timer += Time.deltaTime;
        problemImage.fillAmount = timer / lastingTime;
        if(timer > lastingTime)
        {
            GameFlowManager.Instance.OnGameLose();
        }
    }
}
